<?php
class Pages extends CI_controller {
	public function __construct(){
		parent::__construct();
	}
	public function view($page = 'home'){
		$data['title'] = '标题';
	
		if($this->session->userdata('username') != FALSE && $this->session->userdata('username')){
			$data['userdata'] = $this->session->all_userdata();
		}
		//$data['user']
		if(!file_exists('application/views/pages/'.$page.'.php')){
			show_404();
		}
		$this->load->view('templates/header', $data);
		$this->load->view('pages/'.$page, $data);
		$this->load->view('templates/footer', $data);
//		echo '<pre>';
//		print_r($this->session->all_userdata());
//		echo '</pre>';
//		print_r($_SERVER);
	}
}